package com.ys.util
{
	
	public class XMLUtil
	{
		public static function loopThrougXMLData(xml:XML, collection:Array):void
		{
			var len:int = xml.children().length()
			var i:int = 0;
			var j:int = 0;
			var child:XML;
			var childName:String;
			var childValue:String;
			var childLen:int;
			var tag:Array;
			var tagName:String;
			var art:XML;
			var path:String;
			var id:String;
			var ext:String = '.mp3';
			var classID:String;
			var p:String;
			
			var tempTag:String;
			var pattern:Array = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'C2'];
			
			for (i = 0; i < len; i++) 
			{
				child = xml.children()[i];
				childValue = child.children();
				childName = child.name().toString();
				childLen = child.length();
				
				if (childName == 'item')
				{
					id = child.@id;
					classID = child.@classID;
					
					for (j = 0; j < pattern.length; j++)
					{
						p = pattern[j];
						collection[id + p] = SoundConst[classID+p]; 
					}
				} 
			}
		}

	}
}